<?php

class Aes
{
    public function encrypt($str, $key, $iv)
    {
        return openssl_encrypt($str, 'AES-128-CBC', $key, OPENSSL_ZERO_PADDING, $iv);
    }

    public function decrypt($str, $key, $iv)
    {
        return openssl_decrypt($str, 'AES-128-CBC', $key, OPENSSL_ZERO_PADDING, $iv);
    }
}